home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 53 / 053.d81 / morse code (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  9.8 KB  |  261 lines

  1. 10 gosub2130:print"[147]":poke53281,.:poke53280,.
  2. 20 diml$(38),m$(38),w$(200),l1$(38),h$(200):print"[147]","   [208]lease wait
  3. 30 s1[178]54272:[129]l[178]s1[164]s1[170]24:[151]l,.:[130]:[151]s1[170]24,15:[151]s1[170]5,.
  4. 40 [151]s1[170]6,240:[151]s1[170]3,8:[129]l[178].[164]8:[135]a(l):[130]:dt$[178]".":ds$[178]"-"
  5. 50 [129]l[178]0[164]38:[135]l$(l),m$(l):l1$(l)[178][199]([198](l$(l))[170]128):[130]
  6. 60 sp$[178]"                                       "
  7. 70 [135]w$(z):[139]w$(z)[179][177]"#"[167]z[178]z[170]1:[137]70
  8. 80 [135] h$(t)
  9. 90 [139]h$(t)[178]"#"[167]h$(t)[178]h$(t[171]1)
  10. 100 [139]h$(t)[179][177]"%"[167]t[178]t[170]1:[137]80
  11. 110 pu[178]z:[153]"stopload"[199](8)[199](14):[141]390:l5[178].:m5[178].:k[178].:tl$[178]""
  12. 120 [153]"sys  right$nternational (NULL)orse lenode (NULL)ranslater":
  13. 130 [153][163]10)"listpeeky mid$ames len. right$anni
  14. 140 print"[159]                [205]enu[146]"
  15. 150 print" [153]1.[150]  [211]ee chart"
  16. 160 print" [153]2.[150]  [212]ranslate from [197]nglish to [205]orse":c$="[144]"
  17. 170 print" [153]3.[150]  [212]ranslate from [205]orse to [197]nglish"
  18. 180 print" [153]4.[150]  [212]est your ability to translate"
  19. 190 print" [153]5.[150]  [195]ustomize [205]orse [195]ode keys"
  20. 191 print" [153]6.[150]  [209][213][201][212]":gosub390
  21. 200 print" [208]lease select your choice :":print""sp$
  22. 210 geta$:ifa$=""then210
  23. 220 ifa$<"1"ora$>"6"then210
  24. 230 lc=s1+1309+(val(a$)-1)*80:forl=lctolc+34:pokel,1:next:ford=1to300:next
  25. 240 onval(a$)goto770,870,1140,1490,3000,1420
  26. 250 print"[175][153][157]";:t$="":p$="":ct=0:c1=0
  27. 260 geta$:gosub360:ifa$=""then260
  28. 270 l=len(t$):a=asc(a$):if(a=47ora=63)andtt=1thengosub2000:goto260
  29. 280 ifa=13andl>.thenprint" ";:return
  30. 290 if(a=20ora=95)andl>.thent$=left$(t$,l-1):a$=chr$(20):goto350
  31. 300 ifa$=" "andl<tl+1then340
  32. 310 ifl>tlthen260
  33. 311 ifm5=0then330
  34. 312 ifa=asc(ds$)thena=45:a$=chr$(a)
  35. 313 ifa=asc(dt$)thena=46:a$=chr$(a)
  36. 320 ifa<>45anda<>46then260
  37. 330 ifl5=1thenif(a<65ora>90)and(a<48ora>57)and(a<>46)and(a<>63)and(a<>44)then260
  38. 340 t$=t$+a$:ifm5=1thengosub450
  39. 350 print"[153]"a$;:print"[175][153][157]";:goto260
  40. 360 ct=ct+1:ifct<3thenreturn
  41. 370 ct=.:c1=c1+1:ifc1>8thenc1=.
  42. 380 poke646,a(c1):print"[175][157]";:return
  43. 390 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][154]";:return
  44. 400 print".";
  45. 410 pokes1+1,50:pokes1+4,65:fort=1to73:next:pokes1+4,64:return
  46. 420 print"-";
  47. 430 pokes1+1,50:pokes1+4,65:fort=1to187:next:pokes1+4,64:return
  48. 440 fort=1to163:next:return
  49. 450 ifa$="."thengosub410:return
  50. 460 ifa$="-"thengosub430:return
  51. 470 return
  52. 480 data0,11,12,15,1,1,12,11,0
  53. 490 dataa,.-,b,-...,c,-.-.,d,-..,e,.,f,..-.,g,--.,h,....,i,..,j,.---
  54. 500 datak,-.-,l,.-..,m,--,n,-.,o,---,p,.--.,q,--.-,r,.-.,s,...,t,-
  55. 510 datau,..-,v,...-,w,.--,x,-..-,y,-.--,z,--..
  56. 520 data0,-----,1,.----,2,..---,3,...--,4,....-,5,.....,6,-....,7,--...
  57. 530 data8,---..,9,----.,",",--..--,".",.-.-.-,?,..--..
  58. 540 datathe,quick,brown,fox,jumped,over,three,lazy,dogs,hello,help
  59. 550 datastranded,island,mayday,send,off,on,goodby,monday,tuesday,thursday
  60. 560 datafriday,saturday,sunday,wednesday,september,october,november,december
  61. 570 datajanuary,february,march,april,may,june,july,august,summer,winter,fall
  62. 580 dataspring,computer,softdisk,yesterday,tomorrow,today,yellow,blue,red
  63. 590 datagreen,copper,iron,gold,silver,bomb,explosive,dynamite,big,small,little
  64. 600 data123,234,345,456,567,678,789,890,153,523,764,".",","
  65. 610 datagiant,guard,ocean,pool,window,pencil,pen,whale,shark,football,baseball
  66. 620 data"#"
  67. 630 dataan article,adjective,color,animal,past verb,adverb,spelled out number
  68. 640 dataadjective,animal,greeting,"*[211]end [198]or ----!"
  69. 650 data"*[212]his usually happens on a island","*[193] piece of land",help signal
  70. 660 dataverb,adverb,adverb,"*[193]dios!","*[196]ay of a week","#"
  71. 670 data"#","#","#","#","#","month","#","#","#","#","#","#","#","#","#","#","#"
  72. 680 dataseason,"#","#","#","*[217]ou are now playing with this","*[193]n awesome company"
  73. 690 data"*[206]ot tomorrow","*[206]ot yesterday","*[201]t's a news show",color,"#","#"
  74. 700 data"#",metal,"#","#","#","*[203][193][193][208][207][207][215]!","*[203][193][193][194][207][207][205]!","*[203][193][193][208][207][215][201][197]",adjective
  75. 710 data"#","#",number,"#","#","#","#","#","#","#","#","#","#",punctuation,"#"
  76. 720 dataadjective,verb,"*[199]igantic body of water","*[204]ots of [195]hlorine"
  77. 730 data"*[217]ou look through this","*[217]ou write with this"
  78. 740 data"#",mammal,fish,"*[201]t's usually played in winter"
  79. 750 data"*[201]t's usually played in spring"
  80. 760 data"%"
  81. 770 print"[147][159]     [201]nternational [205]orse [195]ode [195]hart":gosub390:print""
  82. 780 forl=0to12:print"  "l1$(l)" "m$(l)tab(15)""l1$(l+13)" "m$(l+13)tab(28);
  83. 790 print""l$(l+26)" "m$(l+26):next:ifrtthenrt=0:return
  84. 800 print""
  85. 810 print"[158]            [208]ress [193]ny [203]ey               ";:poke198,0
  86. 820 wait198,255:poke198,0:goto110
  87. 830 foru=1to10
  88. 840 fort=1264+l-len(tl$)to1264+l-1:poket,peek(t)and127:poket+s1,7:next
  89. 850 fort=1264+l-len(tl$)to1264+l-1:poket,peek(t)or128:poket+s1,10
  90. 860 next:next:pokes1+4,32:l=l+1:tl$="":k=.:goto1270
  91. 870 l5=1:tl=78+80
  92. 880 print"[147][159][212]ype in an [197]nglish sentence then ":x1=0:c$="[159]"
  93. 890 print"press [150][210][197][212][213][210][206][146][159] when done."
  94. 900 gosub250:print:gosub1340
  95. 910 forl=1tolen(t$):p$=mid$(t$,l,1)
  96. 920 ifp$=chr$(32)then1040
  97. 930 k=k+1
  98. 940 ifp$=l$(k-1)then980
  99. 950 ifk<39then930
  100. 960 ifrtthenrt=0:return
  101. 970 goto800
  102. 980 ifpos(x)>33andc$="[159]"thenprint:print"":poke199,1:x1=x1+1:ifx1>3thenx1=.:goto1000
  103. 990 m$=m$(k-1):print"[145]"c$;p$"[157][157]";:gosub1100:k=0:nextl:goto960
  104. 1000 print""
  105. 1010 print"[129]       [208]ress any key to continue.      ":poke198,0:wait198,255
  106. 1020 x1=0:print"[145][146]                                       ":gosub1340
  107. 1030 goto980
  108. 1040 ifpos(x)>33thenprint:print"":poke199,1:x1=x1+1:ifx1>3thenx1=0:goto1060
  109. 1050 print" ";:gosub440:k=0:nextl:goto960
  110. 1060 print""
  111. 1070 print"[129]       [208]ress any key to continue.      ":poke198,0:wait198,255
  112. 1080 x1=0:print"[145][146]                                       ":gosub1340
  113. 1090 k=0:nextl:goto960
  114. 1100 print" ";:form=1tolen(m$):p$=mid$(m$,m,1)
  115. 1110 ifp$="-"thengosub420
  116. 1120 ifp$="."thengosub400
  117. 1130 next:return
  118. 1140 m5=1:tl=150:sp=0
  119. 1150 print"[147][159][212]ype in [205]orse [195]ode press [210][197][212][213][210][206][146][159]"
  120. 1160 print"    when done.":gosub1300:poke214,10:print:rt=1:gosub780
  121. 1170 print"":gosub250:print:gosub1380
  122. 1180 forl=1tolen(t$):p$=mid$(t$,l,1):ifp$=" "andtl$=""thenprint" ";:nextl:goto1260
  123. 1190 ifp$=" "orp$=""thengosub1210:nextl:goto1260
  124. 1200 tl$=tl$+p$:nextl:sp=1
  125. 1210 k=.
  126. 1220 k=k+1
  127. 1230 iftl$=m$(k-1)thenprintl$(k-1);:tl$="":goto1270
  128. 1240 ifk<39then1220
  129. 1250 print"[150]*[197][210][210]*";:pokes1+1,3:pokes1+4,33:l=l-1:goto830
  130. 1260 goto800
  131. 1270 ifmid$(t$,l+1,1)=" "thenprint" ";:l=l+1:goto1270
  132. 1280 ifsp=1then800
  133. 1290 return
  134. 1300 print"[159][208]ut 2 spaces before each [158]word."
  135. 1310 print"[159][208]ut 1 space before each [158]letter."
  136. 1320 print"[129][213]se the '"dt$"' and '"ds$"' keys."
  137. 1330 return
  138. 1340 print"":fort=1to12
  139. 1350 print"[159]                                       ":next:print""
  140. 1360 print"[155] [212]ranslation is:                       ":poke199,1
  141. 1370 return
  142. 1380 print"":fort=1to12
  143. 1390 print"[159]                                        ";:next:print""
  144. 1400 print"[155] [212]ranslation is:                        ";
  145. 1410 return
  146. 1420 print" [196]o you wish to quit to [158][204][207][193][196][211][212][193][210]? [152]([217]/[206])"
  147. 1430 geta$:ifa$=""then1430
  148. 1440 ifa$="[217]"ora$="y"then 1460
  149. 1450 ifa$="n"ora$="[206]"thenprint"";:goto 130
  150. 1460 open15,8,15,"r0:hello connect=hello connect":input#15,er,er$:close15
  151. 1470 ifer<>63 then print"[147]":end
  152. 1480 load"hello connect",8,1
  153. 1490 print"[144][147][158]         *** [205]orse [195]ode [212]ests ***   ":gosub390:tt=0
  154. 1500 print" [193].[156]  [205]orse [212]ranslation [212]est"
  155. 1510 print" [194].[156]  [197]nglish [212]ranslation [212]est"
  156. 1520 print" [195].[156]  [210]eturn to [205]ain [205]enu"
  157. 1530 gosub390
  158. 1540 print"[149]     [215]hich one?"
  159. 1550 geta$:ifa$=""then1550
  160. 1560 ifa$<"a"ora$>"c"thengosub410:goto1550
  161. 1570 onasc(a$)-64goto1880,1580,110
  162. 1580 print"[147][158]  *** [212]ranslating [197]nglish to [205]orse ***":gt=1
  163. 1590 gosub390
  164. 1600 rn=int(rnd(1)*pu):gosub1750
  165. 1610 print"[159] [212]he [197]nglish word is:"
  166. 1620 print""tab(20-len(w$)/2)"[129]"w$
  167. 1630 print"[152][212]ype in the [205]orse equivalent:":m5=1:l5=0:tl=39:gosub250
  168. 1640 ift$+" "=m$thengosub1790:goto1680
  169. 1650 gosub1820:rt=1:t$=w$
  170. 1660 gosub2100:print"[129][195]orrect translation for "w$"[146][129] is:[158]"
  171. 1670 gosub910
  172. 1680 poke214,22:print
  173. 1690 printcl$"[208]ress [195] to continue - [193]ny other aborts":gosub1730:fort=1to100:next
  174. 1700 geta$:ifa$=""then1680
  175. 1710 ifa$="c"thenongtgoto1580,1880
  176. 1720 goto1490
  177. 1730 q=1-q:poke646,q*8+6:return
  178. 1740 rem word into morse
  179. 1750 m$="":w$=w$(rn):forl=1tolen(w$):p$=mid$(w$,l,1):m=0
  180. 1760 ifp$=l$(m)thenm$=m$+m$(m)+" ":goto1780
  181. 1770 m=m+1:ifm<39then1760
  182. 1780 next:return
  183. 1790 poke214,9:print:forl=1to80
  184. 1800 poke199,q:print"[159]                 [195][207][210][210][197][195][212]               [145][144]":q=1-q:
  185. 1810 pokes1+1,l*2+q*10:pokes1+4,17:next:pokes1+4,16:return
  186. 1820 forl=-22to22:t=abs(l):poke646,t:pokes1+4,33:pokes1+1,t
  187. 1830 poke214,7:print:printtab(t)"                 "
  188. 1840 printtab(t)"      [215][210][207][206][199]      "
  189. 1850 printtab(t)"                 [144]"
  190. 1860 next:pokes1+4,32
  191. 1870 return
  192. 1880 print"[147][158]  *** [212]ranslating [205]orse to [197]nglish ***":gt=2:m5=0:l5=1:tl=12
  193. 1890 gosub390:printspc(9)"[129][198]or a hint, press "chr$(34)"?"chr$(34)"."
  194. 1900 rn=int(rnd(1)*pu):gosub1750
  195. 1910 print"[155] [212]he [205]orse [195]ode is:":t$=w$:m1$=m$:rt=1:tt=1:hp=0
  196. 1920 print""tab(20-len(m1$)/2);:gosub910:print" ":m$=m1$
  197. 1930 print"[154][212]he [197]nglish equivalent is:"
  198. 1940 gosub250
  199. 1950 ift$=w$thengosub1790:goto1680
  200. 1960 gosub1820
  201. 1970 gosub2100:print"[159][212]he correct word for the [205]orse code:"
  202. 1980 printm$
  203. 1990 print"is [150]"w$:goto1680
  204. 2000 px=pos(0):hp=1-hp:ifhpthen2060
  205. 2010 ty$="[156][212]he first letter of the word is [158]"+mid$(w$,1,1)+"[156]."
  206. 2020 gosub2100:poke214,16:print
  207. 2030 printtab(19-(len(ty$)-2)/2)ty$
  208. 2040 goto2050
  209. 2050 print"";:printtab(px);:return
  210. 2060 ifleft$(h$(rn),1)="*"then2080
  211. 2070 ty$="[149][201]t's a":qq$=left$(h$(rn),1)
  212. 2072 ifqq$="a"orqq$="e"orqq$="i"orqq$="o"orqq$="u"thenty$=ty$+"n"
  213. 2075 ty$=ty$+" "+h$(rn)+"[149].":goto2020
  214. 2080 h$=right$(h$(rn),len(h$(rn))-1)
  215. 2090 ty$="[158]"+h$+"[158].":goto2020
  216. 2100 p=peek(214)-2:poke214,14:print
  217. 2110 forl=1to8:print"                                       ":next
  218. 2120 print:poke214,p:print:return
  219. 2130 poke53265,peek(53265)and239:poke53280,00:poke53281, 1:printchr$(142)"[147][142]";
  220. 2140 print"[154]                                                loadstar proudly prese";
  221. 2150 print"nts                                                                     ";
  222. 2160 print"                         [146]O[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]P[154]             [146][180]";
  223. 2170 print"morsecode[170] [154]            [146][180][144][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]";
  224. 2180 print"[170] [154]            [146][180][170] [154]            [146][180]b";
  225. 2190 print"yjamesc.ianni[170] [154]            [146][180][170] [154]  ";
  226. 2200 print"          [146][180][155].-..---.--.....-.-[170] [154]            [146][180][155].-......";
  227. 2210 print"-...----...[170] [154]            [146][180][155]..-..----[170] [154]     ";
  228. 2220 print"       [146][180][170] [154]            [146]L[175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175]";
  229. 2230 print"[175][175][175][175][175][175][175][175][186] [154]                                        [154]                 ";
  230. 2240 print"                                    [146][156]O[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]P[154]       ";
  231. 2250 print"        [146][156][180][150]copyright1988[156][167] [154]              [146][156]L[175][175][175][175][175][175][175][175][175][175][175][175][175][175]";
  232. 2260 print"[175][175][175][175][175][175][175][175][175][186] [154]                                        [154]                ";
  233. 2270 print"                                                                      [160] ";
  234. 2280 print"       press (space) to continue        [160]                               ";
  235. 2290 print"     "
  236. 2300 poke2023,96+128:poke56295,14
  237. 2310 poke53265,peek(53265)or16
  238. 2320 geta$:ifa$<>" "then 2320
  239. 2330 return
  240. 3000 print"[147][158]  *** [195][213][211][212][207][205][201][218][201][206][199] [205][207][210][211][197][160][195][207][196][197][160][203][197][217][211] ***"
  241. 3001 print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  242. 3005 print"[152][195]urrent [203]eys are '"dt$"[152]' for [196][207][212][211]
  243. 3006 [153]"                  and '"ds$"print#' for str$atn(NULL)left$val(NULL)"
  244. 3007 [153]"           1print#)cont lenhange str$ots"
  245. 3008 [153]"           2print#)cont lenhange str$ashes"
  246. 3009 [153]"           3print#)cont (NULL)(NULL)right$(NULL) to (NULL)ain (NULL)enu"
  247. 3010 [153]"          valnter menu selection
  248. 3020 geta$:ifa$<"1"ora$>"3"then3020
  249. 3030 onval(a$) goto 3200,3100,110
  250. 3040 goto 3020
  251. 3100 print"   [197]nter the [206][197][215] character for dashes."
  252. 3101 geta$:ifa$=""then 3101
  253. 3103 ifa$<" "ora$>"z"anda$<"[193]"ora$>"[218]" then 3101
  254. 3104 ifa$=dt$ then 3101
  255. 3105 ds$=a$:goto 3000
  256. 3200 print"   [197]nter the [206][197][215] character for dots."
  257. 3202 geta$:ifa$=""then3202
  258. 3203 ifa$<" "ora$>"z"anda$<"[193]"ora$>"[218]" then 3202
  259. 3204 ifa$=ds$ then 3202
  260. 3205 dt$=a$:goto 3000
  261.